add.alpha <- function(col, alpha=1){
#--------------------------------------------------------------------------------------------------------------------------------------------#
# K Lloyd 2016_09_16
# FROM https://gist.github.com/mages/5339689
#--------------------------------------------------------------------------------------------------------------------------------------------#
  if(missing(col))
    stop("Please provide a vector of colours.")
  apply(sapply(col, col2rgb)/255, 2, 
                     function(x) 
                       rgb(x[1], x[2], x[3], alpha=alpha))  
}
